package com.bridge.bridge_wd.activity;

import android.app.Activity;
import android.view.View;

import com.bridge.bridge_wd.R;
import com.bridge.bridge_wd.databinding.ActivityMyinforBinding;
import com.bridge.bridge_wd.dialog.PictureSelectDialog;
import com.bridge.common.base.BaseActivity;
import com.bridge.common.pic.GlideEngine;
import com.bridge.common.utils.CalendarDayUtils;
import com.bridge.common.utils.UltimateBarXUtils;
import com.huantansheng.easyphotos.EasyPhotos;

/**
 * @ClassName MyInforActivity
 * @Description TODO消息
 * @Author xushufeng
 * @CreateDate 2021/4/11 0011 11:01
 * @Version 1.0
 * @UpdateDate 2021/4/11 0011 11:01
 * @UpdateRemark 更新说明
 */
public class MyInforActivity extends BaseActivity {
    private ActivityMyinforBinding binding;

    @Override
    protected int layoutId() {
        return R.layout.activity_myinfor;
    }

    @Override
    protected void initView() {

        binding = getBind();
        binding.linearMyInfor.setOnClickListener(this);
        binding.linearMyEwm.setOnClickListener(this);
        binding.linearMyName.setOnClickListener(this);
        binding.linearMyXingbie.setOnClickListener(this);
        binding.linearMyShengri.setOnClickListener(this);
        UltimateBarXUtils.setAppBar(this, true, true, R.color.color_f5f5f5);

    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        if (view.getId() == R.id.linear_my_infor) {
            showPictureDialog(this);
        }
        if (view.getId() == R.id.linear_my_ewm) {
            turnToActivity(ErWeiCodeActivity.class);
        }
        if (view.getId() == R.id.linear_my_name) {
            turnToActivity(SetNameActivity.class);
        }
        if (view.getId() == R.id.linear_my_xingbie) {
            turnToActivity(XingBieActivity.class);
        }
        if (view.getId() == R.id.linear_my_shengri) {
            CalendarDayUtils.getInstance(MyInforActivity.this).setDateTime().show(binding.tvShengri);
        }

    }

    @Override
    protected void setListenner() {

    }

    //选择图片弹窗
    private PictureSelectDialog pictureSelectDialog;

    public void showPictureDialog(Activity activity) {
        if (pictureSelectDialog == null) {
            pictureSelectDialog = new PictureSelectDialog(activity, R.style.easy_dialog_style);
        }
        pictureSelectDialog.show();
        pictureSelectDialog.setDialogViewListener(new PictureSelectDialog.DialogViewListener() {
            @Override
            public void cameraClick() {//拍照

            }

            @Override
            public void selectClick() {//相册

            }
        });
    }

}
